package com.meichuang.meipian.video.music;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ken on 17/11/12.
 */

public class MusicUtil {
    static List<MusicPlayUtil> mList = new ArrayList<MusicPlayUtil>();
    static float musicvolume = 1;
    public static String musicStatusChange(String json){
        MusicModel model = new MusicModel();
        model.valueFromJson(json);
        model.audioVolume = musicvolume;
        MusicPlayUtil m = new MusicPlayUtil();
        m.play(model);
        mList.add(m);
        return " YES Playe ";
    }
    public static void distory(){
        for(int i=0;i<mList.size();i++){
            mList.get(i).distoryMusic();
        }
        mList.clear();
    }
    public static void pause(){
        for(int i=0;i<mList.size();i++){
            mList.get(i).pause();
        }
    }
    public static void setVolume(float volume){
        musicvolume = volume;
        for(int i=0;i<mList.size();i++){
            mList.get(i).setVolume(volume);
        }
    }
}
